<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .box {
            width: 400px;
            height: 100px;
            background: linear-gradient(to top, pink, yellow);
            position: absolute;
            animation: move 2s infinite
        }
        
        body {
            background: linear-gradient(to right, pink, skyblue);
        }
        
        @keyframes move {
            0% {
                left: 0;
                top: 0;
                background-color: pink;
                transform: scale(1);
            }
            25% {
                left: 500px;
                top: 0;
                background-color: purple;
                transform: scale(1);
            }
            50% {
                left: 500px;
                top: 500px;
                background-color: orange;
                transform: scale(1);
            }
            75% {
                left: 0;
                top: 500px;
                background-color: skyblue;
                transform: scale(1);
            }
            100% {
                left: 0;
                top: 0;
                border-radius: 50%;
                transform: scale(2);
            }
        }
    </style>
</head>

<body>
    <div class="box">

    </div>
</body>

</html>